package com.example.singleton;

/**
 * @Description TODO
 * @Date 2021/10/25 8:29
 * @Author ZhangJi
 * @Version 1.0
 */
public class LazySingleObject {

  private static LazySingleObject SINGLE_OBJECT;

  public LazySingleObject() {
  }

  public static synchronized LazySingleObject getSingleObject(){
    if (SINGLE_OBJECT == null) {
      SINGLE_OBJECT = new LazySingleObject();
    }
    return SINGLE_OBJECT;
  }

  public void showMessige(){
    System.out.println("Hello World, LazySingleObject!");
  }

}
